
package tomcat;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Title: <P>SimpleServlet.java</P>
 * @Package <P>com.xs.tomcat</P>
 * @Description: <P>TODO该类...</P>
 * @author renweiping
 * @date 2019年1月14日 下午5:59:52
 * @version 1.0
 */

public class SimpleServlet extends HttpServlet{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	
	
	  public void init() throws ServletException {
	        System.out.println("SimpleServlet init ");
	   }
	
	/* (non-Javadoc)
	 * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		req.setCharacterEncoding("UTF-8");
		resp.setContentType("text/html;charSet=utf-8");
		resp.setCharacterEncoding("UTF-8");
		String msg = req.getParameter("msg");
		resp.getWriter().write("you say:"+msg);
	}
}
